
#define PINSEL0_SCL0 (0B01<<4)
#define PINSEL0_SDA0 (0b01<<6)
#define PINSEL0_SCL1 (0B11<<22)
#define PINSEL0_SDA1 (0b11<<28)

#define acc_add 0b00111000
#define gyro_add 0b11010000

#define OUT_X_LSB 0x05
#define OUT_X_MSB 0x06
#define OUT_Y_LSB 0x07 
#define OUT_Y_MSB 0x08
#define OUT_Z_LSB 0x09 
#define OUT_Z_MSB 0x0A
#define CTRL_REG1 0x38

#define acc_init 0b00001101  //50hz +-2g


void i2c_init(void);
void i2c_acc_init(void);
void get_acc_x(void);
float get_acc_y(void);
float get_acc_z(void);
void I2CISR(void);
float acc_cal_x(void);
float acc_cal_z(void);
float acc_cal_y(void);
char acc_test(void);